package com.sxf.common.enums;

import com.sxf.consts.ISystemCode;

/**
 * 
 * @description: 系统编码枚举
 * @author: zhangyb@ccccit.com.cn 
 * @date: 2020年12月31日 上午9:47:57
 */
public enum SystemCommonCodeEnum implements ISystemCode {
	/**
	 * 成功
	 */
	SUCCESS(SystemCommonCode.SUCCESS,"成功"),
	
	/**
	 * 内部错误
	 */
	INTERNAL_ERR(SystemCommonCode.INTERNAL_ERR,"内部错误"),
	
	/**
	 * 内容不存在
	 */
	NOTFOUND_ERR(SystemCommonCode.NOTFOUND_ERR,"内容不存在"),
	
	/**
	 * 业务错误
	 */
	BUSINESS_ERR(SystemCommonCode.BUSINESS_ERR,"业务错误"),
	
	/**
	 * 参数错误
	 */
	ILLEGL_PARAM_ERR(SystemCommonCode.ILLEGL_PARAM_ERR,"参数错误"),
	
	/**
	 * 远程调用错误
	 */
	RPC_ERR(SystemCommonCode.RPC_ERR,"远程调用错误"),
	
	/**
	 * 数据访问错误
	 */
	DATA_ACCESS_ERR(SystemCommonCode.DATA_ACCESS_ERR,"数据访问错误"),
	
	/**
	 * 认证失败
	 */
	AUTH_ERR(SystemCommonCode.AUTH_ERR,"认证失败"),
	
	/**
	 * 权限异常
	 */
	PERMISSION_ERR(SystemCommonCode.PERMISSION_ERR,"权限异常"),
	
	/**
	 * 资源占用异常
	 */
	RESOURCE_LOCKED_ERR(SystemCommonCode.RESOURCE_LOCKED_ERR,"资源占用异常"),
	
	/**
	 * 认证失败，客户端未登录
	 */
	AUTH_TOKEN_EMPTY_ERR(SystemCommonCode.AUTH_TOKEN_EMPTY_ERR,"认证失败，客户端未登录"),
	
	/**
	 * 认证失败，token无效
	 */
	AUTH_TOKEN_INVALID_ERR(SystemCommonCode.AUTH_TOKEN_INVALID_ERR,"认证失败，token无效"),
	
	/**
	 * 认证失败，统一认证端token无效
	 */
	AUTH_HUFU_TOKEN_INVALID_ERR(SystemCommonCode.AUTH_HUFU_TOKEN_INVALID_ERR,"认证失败，统一认证端token无效"),
	
	/**
	 * 失败次数短时间内过于频繁
	 */
	LOGIN_FAIL_TOMUCH_ERR(SystemCommonCode.LOGIN_FAIL_TOMUCH_ERR,"失败次数短时间内过于频繁"),
	
	/**
	 * 请求发送短时间内过于频繁
	 */
	FREQUENT_REQUEST_ERR(SystemCommonCode.FREQUENT_REQUEST_ERR,"请求发送短时间内过于频繁")
	;
	
	private int status;
	private String statusInfo;
	
	SystemCommonCodeEnum(int status, String statusInfo) {
		this.status = status;
		this.statusInfo = statusInfo;
	}

	@Override
	public int getCode() {
		return status;
	}

	@Override
	public String getMessage(Object... params) {
		return statusInfo;
	}

}
